how to determine the end behavior